package cn.sunxyz.data.sample;

import cn.sunxyz.data.orm.impl.DefaultQueryProxy;
import cn.sunxyz.data.sample.dao.UserDao;
import cn.sunxyz.data.sample.domain.User;
import cn.sunxyz.data.sample.domain.UserDO;

import java.util.List;

/**
 * Created by yangrd on 2017/6/5.
 */
public class Proxys {

    public static void test() {
        UserDao userDao = new DefaultQueryProxy().getMapper(UserDao.class);

////        userDao.delete(2);
////        userDao.save(new User());
        userDao.findAll().forEach(System.out::println);
        User user = userDao.findOne(1);
        System.out.println(user);
        User user1 = userDao.findById(1);
        System.out.println(user1);
        user1 = userDao.findById(1);
        user1 = userDao.findById(1);
        List<UserDO> list = userDao.findByNameLike("%9");
        System.out.println(list);
//
///*        int num = userDao.deleteByNameLike("%9");
//        System.out.println(num);*/
    }

    public static void main(String[] args) {
        test();
    }
}
